NexusPi Git Node
lib/microReticulum/src/FileStream.h copilot/add-rtnode-configuration-options (9529fa8a) Text, 4.42 KB
Tff7b72#Tff7b72pragma once
Tff7b72#Tff7b72include T8b949e"Utilities/Crc.h"
Tff7b72#Tff7b72include T8b949e"Log.h"
Tff7b72#Tff7b72include T8b949e"Bytes.h"
Tff7b72#Tff7b72include T8b949e"Type.h"
Tff7b72#Tff7b72ifdef ARDUINO
Tff7b72#Tff7b72include T8b949e<Stream.h>
Tff7b72#Tff7b72else
Tff7b72#Tff7b72include T8b949e"Utilities/Stream.h"
Tff7b72#Tff7b72endif
Tff7b72#Tff7b72include T8b949e<list>
Tff7b72#Tff7b72include T8b949e<memory>
Tff7b72#Tff7b72include T8b949e<cassert>
Tff7b72#Tff7b72include T8b949e<stdint.h>
Te6edf3namespace Te6edf3RNS Tb4b4b4{
Te6edf3class Te6edf3FileStreamImpl Tb4b4b4{
Te6edf3protectedTff7b72:
Te6edf3FileStreamImplTb4b4b4(Tb4b4b4) Tb4b4b4{ Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStreamImpl object created, this: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4)Tb4b4b4; Tb4b4b4}
Te6edf3publicTff7b72:
Te6edf3virtual Tff7b72~Te6edf3FileStreamImplTb4b4b4(Tb4b4b4) Tb4b4b4{ Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStreamImpl object destroyed, this: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4)Tb4b4b4; Tb4b4b4}
Te6edf3protectedTff7b72:
T8b949e// CBA TODO Can these be pure-virtual???
Te6edf3virtual Tff7b72const Tffa657charTff7b72* Te6edf3nameTb4b4b4(Tb4b4b4) Tff7b72= T79c0ff0Tb4b4b4;
Te6edf3virtual Tffa657size_t Te6edf3sizeTb4b4b4(Tb4b4b4) Tff7b72= T79c0ff0Tb4b4b4;
Te6edf3virtual Tffa657void Te6edf3closeTb4b4b4(Tb4b4b4) Tff7b72= T79c0ff0Tb4b4b4;
T8b949e// Print overrides
Te6edf3virtual Tffa657size_t Te6edf3writeTb4b4b4(Tffa657uint8_t Te6edf3byteTb4b4b4) Tff7b72= T79c0ff0Tb4b4b4;
Te6edf3virtual Tffa657size_t Te6edf3writeTb4b4b4(Tff7b72const Tffa657uint8_t Tff7b72*Te6edf3bufferTb4b4b4, Tffa657size_t Te6edf3sizeTb4b4b4) Tff7b72= T79c0ff0Tb4b4b4;
T8b949e// Stream overrides
Te6edf3virtual Tffa657int Te6edf3availableTb4b4b4(Tb4b4b4) Tff7b72= T79c0ff0Tb4b4b4;
Te6edf3virtual Tffa657int Te6edf3readTb4b4b4(Tb4b4b4) Tff7b72= T79c0ff0Tb4b4b4;
Te6edf3virtual Tffa657int Te6edf3peekTb4b4b4(Tb4b4b4) Tff7b72= T79c0ff0Tb4b4b4;
Te6edf3virtual Tffa657void Te6edf3flushTb4b4b4(Tb4b4b4) Tff7b72= T79c0ff0Tb4b4b4;
Te6edf3friend Te6edf3class Te6edf3FileStreamTb4b4b4;
Tb4b4b4}Tb4b4b4;
Te6edf3class Te6edf3FileStream Tff7b72: Te6edf3public Te6edf3Stream Tb4b4b4{
Te6edf3publicTff7b72:
Tff7b72enum Te6edf3MODE Tb4b4b4{
Te6edf3MODE_READTb4b4b4,
Te6edf3MODE_WRITETb4b4b4,
Te6edf3MODE_APPENDTb4b4b4,
Tb4b4b4}Tb4b4b4;
Te6edf3publicTff7b72:
Te6edf3FileStreamTb4b4b4(Te6edf3TypeTff7b72:Tff7b72:Te6edf3NoneConstructor Te6edf3noneTb4b4b4) Tb4b4b4{
Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStream NONE object created, this: 0x%X, impl: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4, Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Tb4b4b4}
Te6edf3FileStreamTb4b4b4(Tff7b72const Te6edf3FileStreamTff7b72& Te6edf3objTb4b4b4) Tff7b72: Te6edf3_implTb4b4b4(Te6edf3objTb4b4b4.Te6edf3_implTb4b4b4)Tb4b4b4, Te6edf3_crcTb4b4b4(Te6edf3objTb4b4b4.Te6edf3_crcTb4b4b4) Tb4b4b4{
Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStream object copy created, this: 0x%X, impl: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4, Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Tb4b4b4}
Te6edf3FileStreamTb4b4b4(Te6edf3FileStreamImplTff7b72* Te6edf3implTb4b4b4) Tff7b72: Te6edf3_implTb4b4b4(Te6edf3implTb4b4b4) Tb4b4b4{
Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStream object impl created, this: 0x%X, impl: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4, Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Tb4b4b4}
Te6edf3virtual Tff7b72~Te6edf3FileStreamTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStream object destroyed, this: 0x%X, impl: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4, Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Tb4b4b4}
Tff7b72inline Te6edf3virtual Te6edf3FileStreamTff7b72& Te6edf3operator Tff7b72= Tb4b4b4(Tff7b72const Te6edf3FileStreamTff7b72& Te6edf3objTb4b4b4) Tb4b4b4{
Te6edf3_impl Tff7b72= Te6edf3objTb4b4b4.Te6edf3_implTb4b4b4;
Te6edf3_crc Tff7b72= Te6edf3objTb4b4b4.Te6edf3_crcTb4b4b4;
Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStream object copy created by assignment, this: 0x%X, impl: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4, Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Tff7b72return Tff7b72*Te6edf3thisTb4b4b4;
Tb4b4b4}
Tff7b72inline Te6edf3FileStreamTff7b72& Te6edf3operator Tff7b72= Tb4b4b4(Te6edf3FileStreamImplTff7b72* Te6edf3implTb4b4b4) Tb4b4b4{
Te6edf3_implTb4b4b4.Te6edf3resetTb4b4b4(Te6edf3implTb4b4b4)Tb4b4b4;
Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStream object copy created by impl assignment, this: 0x%X, impl: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4, Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Tff7b72return Tff7b72*Te6edf3thisTb4b4b4;
Tb4b4b4}
Tff7b72inline Te6edf3operator Tffa657boolTb4b4b4(Tb4b4b4) Tff7b72const Tb4b4b4{
Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStream object bool, this: 0x%X, impl: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4, Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Tff7b72return Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4) Tff7b72!Tff7b72= Tffa657nullptrTb4b4b4;
Tb4b4b4}
Tff7b72inline Tffa657bool Te6edf3operator Tff7b72< Tb4b4b4(Tff7b72const Te6edf3FileStreamTff7b72& Te6edf3objTb4b4b4) Tff7b72const Tb4b4b4{
Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStream object <, this: 0x%X, impl: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4, Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Tff7b72return Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4) Tff7b72< Te6edf3objTb4b4b4.Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4;
Tb4b4b4}
Tff7b72inline Tffa657bool Te6edf3operator Tff7b72> Tb4b4b4(Tff7b72const Te6edf3FileStreamTff7b72& Te6edf3objTb4b4b4) Tff7b72const Tb4b4b4{
Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStream object <, this: 0x%X, impl: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4, Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Tff7b72return Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4) Tff7b72> Te6edf3objTb4b4b4.Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4;
Tb4b4b4}
Tff7b72inline Tffa657bool Te6edf3operator Tff7b72=Tff7b72= Tb4b4b4(Tff7b72const Te6edf3FileStreamTff7b72& Te6edf3objTb4b4b4) Tff7b72const Tb4b4b4{
Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStream object ==, this: 0x%X, impl: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4, Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Tff7b72return Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4) Tff7b72=Tff7b72= Te6edf3objTb4b4b4.Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4;
Tb4b4b4}
Tff7b72inline Tffa657bool Te6edf3operator Tff7b72!Tff7b72= Tb4b4b4(Tff7b72const Te6edf3FileStreamTff7b72& Te6edf3objTb4b4b4) Tff7b72const Tb4b4b4{
Te6edf3MEMFTb4b4b4(Ta5d6ff"Ta5d6ffFileStream object !=, this: 0x%X, impl: 0x%XTa5d6ff"Tb4b4b4, Te6edf3thisTb4b4b4, Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Tff7b72return Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4) Tff7b72!Tff7b72= Te6edf3objTb4b4b4.Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4;
Tb4b4b4}
Tff7b72inline Te6edf3FileStreamImplTff7b72* Te6edf3getTb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72return Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4;
Tb4b4b4}
Tff7b72inline Tffa657void Te6edf3clearTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3_implTb4b4b4.Te6edf3resetTb4b4b4(Tb4b4b4)Tb4b4b4;
Tb4b4b4}
Te6edf3publicTff7b72:
Tff7b72inline Tffa657uint32_t Te6edf3crcTb4b4b4(Tb4b4b4) Tb4b4b4{ Tff7b72return Te6edf3_crcTb4b4b4; Tb4b4b4}
Tff7b72inline Tffa657size_t Te6edf3writeTb4b4b4(Tff7b72const Tffa657charTff7b72* Te6edf3strTb4b4b4) Tb4b4b4{ Tff7b72return Te6edf3writeTb4b4b4(Tb4b4b4(Tff7b72const Tffa657uint8_tTff7b72*Tb4b4b4)Te6edf3strTb4b4b4, Te6edf3strlenTb4b4b4(Te6edf3strTb4b4b4)Tb4b4b4)Tb4b4b4; Tb4b4b4}
T8b949e// File overrides
Tff7b72inline Tff7b72const Tffa657charTff7b72* Te6edf3nameTb4b4b4(Tb4b4b4) Tb4b4b4{ Te6edf3assertTb4b4b4(Te6edf3_implTb4b4b4)Tb4b4b4; Tff7b72return Te6edf3_implTff7b72-Tff7b72>Te6edf3nameTb4b4b4(Tb4b4b4)Tb4b4b4; Tb4b4b4}
Tff7b72inline Tffa657size_t Te6edf3sizeTb4b4b4(Tb4b4b4) Tb4b4b4{ Te6edf3assertTb4b4b4(Te6edf3_implTb4b4b4)Tb4b4b4; Tff7b72return Te6edf3_implTff7b72-Tff7b72>Te6edf3sizeTb4b4b4(Tb4b4b4)Tb4b4b4; Tb4b4b4}
Tff7b72inline Tffa657void Te6edf3closeTb4b4b4(Tb4b4b4) Tb4b4b4{ Te6edf3assertTb4b4b4(Te6edf3_implTb4b4b4)Tb4b4b4; Te6edf3_implTff7b72-Tff7b72>Te6edf3closeTb4b4b4(Tb4b4b4)Tb4b4b4; Tb4b4b4}
T8b949e// Print overrides
Tff7b72inline Tffa657size_t Te6edf3writeTb4b4b4(Tffa657uint8_t Te6edf3byteTb4b4b4) Tb4b4b4{ Te6edf3assertTb4b4b4(Te6edf3_implTb4b4b4)Tb4b4b4; Te6edf3_crc Tff7b72= Te6edf3UtilitiesTff7b72:Tff7b72:Te6edf3CrcTff7b72:Tff7b72:Te6edf3crc32Tb4b4b4(Te6edf3_crcTb4b4b4, Te6edf3byteTb4b4b4)Tb4b4b4; Tff7b72return Te6edf3_implTff7b72-Tff7b72>Te6edf3writeTb4b4b4(Te6edf3byteTb4b4b4)Tb4b4b4; Tb4b4b4}
Tff7b72inline Tffa657size_t Te6edf3writeTb4b4b4(Tff7b72const Tffa657uint8_t Tff7b72*Te6edf3bufferTb4b4b4, Tffa657size_t Te6edf3sizeTb4b4b4) Tb4b4b4{ Te6edf3assertTb4b4b4(Te6edf3_implTb4b4b4)Tb4b4b4; Te6edf3_crc Tff7b72= Te6edf3UtilitiesTff7b72:Tff7b72:Te6edf3CrcTff7b72:Tff7b72:Te6edf3crc32Tb4b4b4(Te6edf3_crcTb4b4b4, Te6edf3bufferTb4b4b4, Te6edf3sizeTb4b4b4)Tb4b4b4; Tff7b72return Te6edf3_implTff7b72-Tff7b72>Te6edf3writeTb4b4b4(Te6edf3bufferTb4b4b4, Te6edf3sizeTb4b4b4)Tb4b4b4; Tb4b4b4}
T8b949e// Stream overrides
Tff7b72inline Tffa657int Te6edf3availableTb4b4b4(Tb4b4b4) Tb4b4b4{ Te6edf3assertTb4b4b4(Te6edf3_implTb4b4b4)Tb4b4b4; Tff7b72return Te6edf3_implTff7b72-Tff7b72>Te6edf3availableTb4b4b4(Tb4b4b4)Tb4b4b4; Tb4b4b4}
Tff7b72inline Tffa657int Te6edf3readTb4b4b4(Tb4b4b4) Tb4b4b4{ Te6edf3assertTb4b4b4(Te6edf3_implTb4b4b4)Tb4b4b4; Tff7b72if Tb4b4b4(Te6edf3_implTff7b72-Tff7b72>Te6edf3availableTb4b4b4(Tb4b4b4) Tff7b72<Tff7b72= T79c0ff0Tb4b4b4) Tff7b72return Te6edf3EOFTb4b4b4; Tffa657int Te6edf3ch Tff7b72= Te6edf3_implTff7b72-Tff7b72>Te6edf3readTb4b4b4(Tb4b4b4)Tb4b4b4; Tffa657uint8_t Te6edf3byte Tff7b72= Tb4b4b4(Tffa657uint8_tTb4b4b4)Te6edf3chTb4b4b4; Te6edf3_crc Tff7b72= Te6edf3UtilitiesTff7b72:Tff7b72:Te6edf3CrcTff7b72:Tff7b72:Te6edf3crc32Tb4b4b4(Te6edf3_crcTb4b4b4, Te6edf3byteTb4b4b4)Tb4b4b4; Tff7b72return Te6edf3chTb4b4b4; Tb4b4b4}
Tff7b72inline Tffa657int Te6edf3peekTb4b4b4(Tb4b4b4) Tb4b4b4{ Te6edf3assertTb4b4b4(Te6edf3_implTb4b4b4)Tb4b4b4; Tff7b72return Te6edf3_implTff7b72-Tff7b72>Te6edf3peekTb4b4b4(Tb4b4b4)Tb4b4b4; Tb4b4b4}
Tff7b72inline Tffa657void Te6edf3flushTb4b4b4(Tb4b4b4) Tb4b4b4{ Te6edf3assertTb4b4b4(Te6edf3_implTb4b4b4)Tb4b4b4; Te6edf3_implTff7b72-Tff7b72>Te6edf3flushTb4b4b4(Tb4b4b4)Tb4b4b4; Tb4b4b4}
T8b949e// getters/setters
Te6edf3protectedTff7b72:
Te6edf3publicTff7b72:
Tff7b72#Tff7b72ifndef NDEBUG
Tff7b72inline Te6edf3stdTff7b72:Tff7b72:Te6edf3string Te6edf3debugStringTb4b4b4(Tb4b4b4) Tff7b72const Tb4b4b4{
Te6edf3stdTff7b72:Tff7b72:Te6edf3string Te6edf3dumpTb4b4b4;
Te6edf3dump Tff7b72= Ta5d6ff"Ta5d6ffFileStream object, this: Ta5d6ff" Tff7b72+ Te6edf3stdTff7b72:Tff7b72:Te6edf3to_stringTb4b4b4(Tb4b4b4(Tffa657uintptr_tTb4b4b4)Te6edf3thisTb4b4b4) Tff7b72+ Ta5d6ff"Ta5d6ff, data: Ta5d6ff" Tff7b72+ Te6edf3stdTff7b72:Tff7b72:Te6edf3to_stringTb4b4b4(Tb4b4b4(Tffa657uintptr_tTb4b4b4)Te6edf3_implTb4b4b4.Te6edf3getTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4;
Tff7b72return Te6edf3dumpTb4b4b4;
Tb4b4b4}
Tff7b72#Tff7b72endif
Te6edf3protectedTff7b72:
Te6edf3stdTff7b72:Tff7b72:Te6edf3shared_ptrTff7b72<Te6edf3FileStreamImplTff7b72> Te6edf3_implTb4b4b4;
Tffa657uint32_t Te6edf3_crc Tff7b72= T79c0ff0Tb4b4b4;
Tb4b4b4}Tb4b4b4;
Tb4b4b4}
Served by rngit 1.4.2 - Generated in 0.04s